package com.lottery.exception;

import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("exception")
@Slf4j//测试公共异常拦截
public class TestExceptionController {

    @GetMapping("null")
    public String nuLL() {
        Object o = null;
        log.info(o.toString());
        return o.toString();
    }

    @GetMapping("runtime")
    public void runtime() {
        Integer.parseInt("abc");
    }

    @GetMapping("custom")
    public void custom() {
        throw new BizException("-1", "自定义异常");
    }
}
